package Lesson18Homework;

public abstract class Person
{
	Person[] persons;
	protected String name;
	protected int age;
	protected boolean isMale;
	
	Person(String name, int age, boolean isMale)
	{
		this.name = name;
		this.age = age;
		this.isMale = isMale;
	}
	
	void showInfo ()
	{
		System.out.println(" ==== Person Info ====");
		System.out.println("Name: " + this.name);
		System.out.println("Age: " + this.age);
		System.out.println("Is male!? " + this.isMale);
	}
	
	

	void calculateOvertime(int overtime) 
	{
		
	}
	
	public void Group(int places) 
	{
		persons = new Person[places];
	}
	
	void addPerson (Person newPerson)
	{

		for (int i = 0; i < persons.length; i++)
		{
			if (persons[i] == null) {
				persons[i] = newPerson;
				return;
			}
		}
		System.out.println("No free places!");
	}
	
}
